#!/usr/bin/env python
#
# Copyright (c) 2011 GhostBSD
#
# See COPYING for licence terms.
#
# gbi_install.py v 0.0 Tuesday, February 22 2011 10:54:53 Eric
#
# gbi_install.py give the job to pc-sysinstall to install GhostBSD.

import pygtk
pygtk.require('2.0')
import gtk, gobject
import os, os.path, sys, stat, shutil

class Installs:
    def close_application(self, widget):
		os.system("killall python")	
    
    def __init__(self):
        window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        window.connect("destroy", self.close_application)
        window.set_size_request(550, 400)  
        window.set_title("Installation")
        window.set_border_width(0)
        window.set_position(gtk.WIN_POS_CENTER)
        try:
            window.set_icon_from_file("G-logo.png")
        except Exception, e:
            print e.message
            sys.exit(1)
        box1 = gtk.VBox(False, 0)
        window.add(box1)
        box1.show()
        box2 = gtk.VBox(False, 10)
        box2.set_border_width(10)
        box1.pack_start(box2, True, True, 0)
        box2.show()
        frame = gtk.Frame("Installation progress")
        self.table = gtk.Table(1, 2, True)  
        self.pbar = gtk.ProgressBar()

        self.table.attach(self.pbar, 0, 2, 0, 1)
        
        frame.add(self.table)
        box2.pack_start(frame, False, False, 0)

        
        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        textview = gtk.TextView()
        textbuffer = textview.get_buffer()
        sw.add(textview)
        sw.show()
        textview.show()

        box2.pack_start(sw)
     
        
     
        window.show_all ()
quit() 
        
def main():
    gtk.main()
    return 0

if __name__ == "__main__":
    Installs()
    main()
    
